import Vue from 'vue'
import Vuex from 'vuex'
import vuexP from 'vuex-persist'
Vue.use(Vuex)
// #ifndef VUE3
export default new Vuex.Store({
// #endif
// #ifdef VUE3
import {createStore} from 'vuex'
export default createStore({
	// #endif
	state:{
		msg:"张三",
		list:['三国演义','西游记','黑与白','小面人']
		
	},
	mutations:{
		change(state){
			state.msg = '李四'
			
		}
	},
	getters:{},
	actions:{},
	modules:{},
	plugins:[
		new vuexP({
			storage:{
				setItem:(key,value)=>uni.setStorageSync(key,value),
				getItem:(key)=>uni.getStorageSync(key),
				removeItem:(key)=>uni.removeStorageSync(key)
			}
		}).plugin
	]
})

